<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>后盾人</title>
  </head>
  <body></body>
  <script>
    let p1 = new Promise((resolve, reject) => {
      // reject("fail");
      resolve("fulfilled");
    })
      .then(
        value => {
          // return "houdunren";
          return new Promise((resolve, reject) => {
            // resolve("解决了");
            setTimeout(() => {
              reject("处理失败");
            }, 3000);
          }).then(null, r => {
            return new Promise((resolve, reject) => {
              reject("失败了。。。。");
            });
          });
        },
        reason => console.log("erorr" + reason)
      )
      .then(
        value => {
          console.log("成功:" + value);
        },
        reason => console.log("error" + reason)
      );
  </script>
</html>
